package com.example.microservice04.feign;

import com.example.microservice04.errorfallback.FallBackExample;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用服务01式例
 *
 * @author czj
 * @date 2019/6/24 2:44 PM
 */
@FeignClient(value = "MICROSERVICE01", fallback = FallBackExample.class)   //value表示要调用的服务名，绝不能填错 fallback表示服务不可用的时候，往哪里跳转
public interface MicroService01FeignTest {

    @GetMapping("/service01/microService01Test")                        //此处名字需要和01服务的controller路径保持一致
    String microService01FeignTest(@RequestParam("str") String str);    //参数一定一定一定要加@RequestParam注解!!!

}
